//
//  MHDataManager.h
//  ManHua
//
//  Created by lanou on 15/11/2.
//  Copyright © 2015年 蓝欧科技. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "FMDatabase.h"
#import "MHMainTopicModel.h"
#import "MHTopicBannerModel.h"
#import "MHComicIntroduct.h"
#import "MHUserInfo.h"
#import "MHHomeCategory.h"
#import "MHHomeBanner.h"
#import "MHCategory.h"
@interface MHDataManager : NSObject
+(instancetype)shareManager;

-(void)createTable;

-(NSMutableArray *)findMainTopicModelData:(NSString *)tableName;

-(void)deleteValueFromeTable:(NSString *)tableName;

-(void)insertValueToTabel:(NSString *)tableName bannerModel:(MHTopicBannerModel *)bannerModel;

-(void)insertValueToTabel:(NSString *)tableName mainTopicModel:(MHMainTopicModel *)mainTopicModel;

-(void)insertValueToTabel:(NSString *)tableName ComicIntroduce:(MHComicIntroduct *)mainBookModel;

-(void)insertUserInfo:(MHUserInfo *)userInfoModel;

- (void)insertUserIcon:(UIImage *)icon UserInfo:(MHUserInfo *)userInfo;

- (MHUserInfo *)getUserInfo;

- (void)deleteUserInfo;

- (void)updateUserNick:(NSString *)nick UserInfo:(MHUserInfo *)userInfo;

- (void)updateUserOther:(NSString *)other UserInfo:(MHUserInfo *)userInfo;

- (void)updateUserSex:(NSString *)sex UserInfo:(MHUserInfo *)userInfo;

- (void)updateUserBirthday:(NSString *)birthday UserInfo:(MHUserInfo *)userInfo;

- (void)insertCollectionListWithComicIntroduct:(MHComicIntroduct *)comicIntroduct;

- (void)insertReadListWithComicIntroduct:(MHComicIntroduct *)comicIntroduct;

- (BOOL)ComicIntroductHasInReadList:(MHComicIntroduct *)comicIntroduct ;
- (BOOL)ComicIntroductHasInCollectionList:(MHComicIntroduct *)comicIntroduct;

- (void)updateReadListtWithComicIntroduct:(MHComicIntroduct *)comicIntroduct;
- (void)deleteCollectionListtWithComicIntroduct:(MHComicIntroduct *)comicIntroduct;

- (NSArray *)getReadList;
- (NSArray *)getCollectionList;
- (MHComicIntroduct *)getComicIntroductWithBookID:(NSInteger)bookId;

-(void)insertValueToTabel:(NSString *)tableName homeCategory:(MHHomeCategory *)homeCategory;
-(void)insertValueToTabel:(NSString *)tableName homeBanner:(MHHomeBanner *)homeBannerModel;

- (void)updateImage:(NSString *)imageurl homeBanner:(MHHomeBanner *)homeBanner;

-(void)insertValueToTabel:(NSString *)tableName ComicIntroduce:(MHComicIntroduct *)mainBookModel categoryID:(NSInteger)categoryID;
-(NSMutableArray *)getCategoryListData:(NSString *)tableName CategoryID:(NSInteger )categoryID;
-(void)insertValueToTabel:(NSString *)tableName category:(MHCategory *)categoryModel;
-(void)deleteFromTable:(NSString *)tableName CategoryID:(NSInteger )categoryID;
@end
